<?php
// +----------------------------------------------------------------------
// | Azthink通用开发平台 [ TOMORROW IS ANOTHER DAY ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018-2019 http://www.azthink.top All rights reserved.
// +----------------------------------------------------------------------
// | Author 李忠<azthink@qq.com>
// +----------------------------------------------------------------------

namespace app\admin\validate;

use think\Validate;

/**
 * 配置验证器
 * @author 李忠<azthink@qq.com>
 * @createAt 2018-08-31 10:29:59
 */
class Config extends Validate {

    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'name' => 'require',
        'title' => 'require',
        'sort' => 'require|number',
        'value' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
        'name.require' => '配置标识不能为空',
        'title.require' => '配置名称不能为空',
        'sort.require' => '排序不能为空',
        'sort.number' => '排序必须为整数',
        'value.require' => '配置值不能为空',
    ];


}